<?php

class HomeController extends BaseController {
	public $crud = false;

	public function dashboard() {

		$data['order'] = $this->getTotals('TOTAL ORDERS', 'shopping-cart', 'up', 100, 100, '#');
		$data['sales'] = $this->getTotals('TOTAL SALES', 'credit-card', 'up', 100, 100, '#');
		$data['customer'] = $this->getTotals('TOTAL CUSTOMERS', 'user', 'up', 100, 100, '#');
		$data['online'] = $this->getTotals('TOTAL ONLINE', 'eye', 'up', 100, 100, '#');
		
		return View::make('dashboard-index')->with($data);
	}

	private function getTotals($title, $icon, $rate, $percentage, $total, $view_more) {
		return View::make('dashboard-total')
			->with(array(
				'title' => $title,
				'icon' => $icon,
				'rate' => $rate,
				'percentage' => $percentage,
				'total' => $total,
				'view_more' => $view_more
			));
	}
}
